#include "Serialization.h"

string rcm_serial (struct ReqCtrlMsg& rcm)
{
	string binary((char*)&rcm, sizeof(struct ReqCtrlMsg));
	return binary;
}

string vcp_serial (struct VrConfPkt& vcp)
{
	string binary ((char*)&vcp, sizeof(struct VrConfPkt));
	return binary;
}

string send_msg(const int inst)
{
	struct ReqCtrlMsg rcm;
	if (inst == SEND_STAT_ALL_ONCE)
	{
		rcm.type = 1;
		rcm.resp = 1;
		rcm.vlink_no = 0;
		rcm.stat = 0;
	}
	else if (inst == SEND_PATH_ALL_ONCE)
	{
		rcm.type = 3;
		rcm.resp = 0;
		rcm.vlink_no = 1;
		rcm.stat = 0;
	}
	string binary((char*)&rcm, sizeof(rcm));
	return binary;
}

